Skip to content

Add Module Composer API#33284

Open
Half-Shot wants to merge 11 commits intodevelopfrom
hs/module-composer-api
Open

Add Module Composer API#33284
Half-Shot wants to merge 11 commits intodevelopfrom
hs/module-composer-api

Conversation

@Half-Shot
Copy link
Copy Markdown
Member

Split out from #33166

Part of a series of PRs to extend the Module API for the integrations team.

This one is the smallest change to add the ability to insert text into the composer.

Checklist

Comment thread apps/web/src/modules/ComposerApi.ts Outdated
export class ComposerApi implements ModuleComposerApi {
public constructor(private readonly dispatcher: MatrixDispatcher) {}

public insertTextIntoComposer(text: string): void {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How useful is this Module API really if you don't know what mode your user's composer is in?

one of 4:

  1. CIDER with markdown enabled (default)
  2. CIDER with markdown disabled (settings)
  3. RTE with rich text enabled (labs)
  4. RTE with rich text disabled (labs)

Depending on which option the user has this Module API will yield very different results, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just make this a plaintext function that's common between all 4 of those kinds. If future module makers want to markdown and go nuts, they can add that functionality. Hopefully in a world where we have fewer composers.

Comment thread packages/module-api/src/api/composer.ts Outdated
* @returns Returns immediately, does not await action.
* @alpha Likely to change
*/
insertTextIntoComposer(text: string): void;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description for the ComposerAPI is to alter the message composer, this method doesn't alter it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had other plans for the composer API, so it will be doing some altering, but maybe I can find a more general phrase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants